package com.carleasoft.mps.cms.business.train.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.carleasoft.mps.cms.business.train.bean.entity.TrainScore;
import com.carleasoft.mps.cms.business.train.bean.po.QueryTrainScoreByUserCodePo;
import com.carleasoft.mps.cms.business.train.bean.po.RegisterPageQuery;
import com.carleasoft.mps.cms.business.train.bean.vo.TrainScoreDetailVo;
import com.carleasoft.mps.cms.business.train.bean.vo.TrainScoreVo;
import com.carleasoft.mps.cms.business.train.bean.vo.UserAndDeptMsgVo;
import com.carleasoft.mps.cms.business.train.dao.TrainScoreMapper;
import com.carleasoft.mps.cms.business.train.service.TrainScoreService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 考核成绩登记表 服务实现类
 * </p>
 *
 * @author fan
 * @since 2023-05-17
 */
@Service
public class TrainScoreServiceImpl extends ServiceImpl<TrainScoreMapper, TrainScore> implements TrainScoreService {

    @Override
    public Page<TrainScoreVo> registerPageQuery(Page page, RegisterPageQuery registerPageQuery) {
        return this.baseMapper.registerPageQuery(page,registerPageQuery);
    }

    @Override
    public TrainScoreDetailVo registerDetail(String scoreCode) {
        return this.baseMapper.registerDetail(scoreCode);
    }

    @Override
    public List<String> getAllDeptCodesByCodeList(List<String> list) {
        return this.baseMapper.getAllDeptCodesByCodeList(list);
    }

    @Override
    public List<TrainScore> getScoreByExamCode(String examCode) {
        List<TrainScore>  res =  this.getBaseMapper().getScoreByExamCode(examCode);
        return res;
    }

    @Override
    public List<UserAndDeptMsgVo> getUserByDeptCodes(List<String> deptCodes) {
        return this.baseMapper.getUserByDeptCodes(deptCodes);
    }

    @Override
    public boolean batchUpdate(List<TrainScore> trainScoreList) {
        return this.baseMapper.batchUpdate(trainScoreList);
    }

    @Override
    public Page<HashMap<String, Object>> queryTrainScoreByUserCode(QueryTrainScoreByUserCodePo queryTrainScoreByUserCodePo) {
        Page page = new Page(queryTrainScoreByUserCodePo.getCurrent(),queryTrainScoreByUserCodePo.getSize());
        return this.baseMapper.queryTrainScoreByUserCode(page,queryTrainScoreByUserCodePo);
    }

    @Override
    public Integer queryScore(List<String> list, String examCode, List<String> rate,Integer type) {
        return this.baseMapper.queryScore(list,examCode,rate,type);
    }

    @Override
    public Integer queryScore1(List<String> list, String examCode, List<String> rate) {
        return this.baseMapper.queryScore1(list,examCode,rate);
    }
}
